'use strict';

module.exports = function collectSameElements(collectionA, collectionB) {
  let result = [];
  for(let item of collectionA){
    if(ChoosetheSame(collectionB,item)){
      result.push(item);
    }
  }
  return result;
}

function ChoosetheSame(collection,i){
  for(let item of collection){
    if(item === i){
      return true;
    }
  }
  return false;
}
